﻿
//Author: 张亚涛
//createtime:2016-01-03 23:25:21
//Description: 

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using DAL;

namespace BLL
{

    /// <summary>
    /// 该类提供了一系列操作 "SmsCode" 表的方法;
    /// </summary>
    public class SmsCodeService
    {
        #region .对本表的维护.
        #region select data
        /// <summary>
        /// 返回SmsCode表的所有数据  
        /// </summary>
        /// <returns></returns>        
        public static List<SmsCode> GetAllSmsCode()
        {
            return SmsCodeBase.GetAllSmsCode();
        }
        /// <summary>
        /// 根据SmsCode表的ID字段返回数据  
        /// </summary>
        /// <param name="id">ID</param>
        /// <returns></returns>        
        public static SmsCode GetSmsCodeById(long id)
        {
            return SmsCodeBase.GetSmsCodeById(id);
        }
        /// <summary>
        /// 判断验证码是否正确
        /// </summary>
        /// <param name="Mobile">手机号</param>
        /// <param name="Code">验证码</param>
        /// <returns>True通过，Flase不通过</returns>
        public static bool Validate(string Mobile, string Code)
        {
            return SmsCodeBase.Validate(Mobile, Code);
        }
        #endregion
        #region delete data
        /// <summary>
        /// 根据SmsCode表的ID字段删除数据 
        /// </summary>
        /// <param name="id">id</param>
        /// <returns>返回受影响的行数</returns>
        public static int DeleteSmsCodeById(long id)
        {
            return SmsCodeBase.DeleteSmsCodeById(id);
        }
        #endregion
        #region update data
        /// <summary>
        /// 根据SmsCode表的ID字段更新数据 
        /// </summary>
        /// <param name="id">Id</param>
        /// <param name="SmsCode">smsCode</param>
        /// <returns>返回受影响的行数</returns>
        public static int UpdateSmsCodeById(SmsCode smsCode)
        {
            return SmsCodeBase.UpdateSmsCodeById(smsCode);
        }
        #endregion
        #region insert data
        /// <summary>
        /// 向SmsCode表插入一条数据，插入成功则返回自增列数值，插入不成功则返回-1 
        /// </summary>
        /// <param name="smsCode">SmsCode</param>        
        /// <returns></returns>
        public static int AddSmsCode(SmsCode smsCode)
        {
            return SmsCodeBase.AddSmsCode(smsCode);
        }
        #endregion
        #endregion

        #region .SQL语句汇总.
        /// <summary>
        /// 返回SmsCode表的所有数据（SQL语句） 
        /// </summary>
        /// <returns></returns>        
        public static string GetAllSmsCode_SQL()
        {
            return SmsCodeBase.GetAllSmsCode_SQL();
        }
        #endregion
    }
}